home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / June 96 / <None>.5 next >
Encoding:
Internet Message Format  |  1996-12-03  |  1.6 KB  |  [TEXT/ttxt]

  1. Subject:     
  2. Sent:        6/11/96 9:41 AM
  3. Received:    6/11/96 9:51 AM
  4. From:        Henri Lamiraux, lamiraux@apple.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. Mary's answer came back to me with an error. So here it is.
  9.  
  10.  
  11. >>What is the proper way to read tab-delimited formatted text from the
  12. >>clipboard. I want to loop, reading up to the next tab or return and parsing
  13. >>the text.
  14.  
  15. >>I have looked at FW_CString, which has methods for searching a character,
  16. >>and FW_CTextReader, which don't have such methods. I am not clear if I must
  17. >>use one or the other, or both.
  18.  
  19. I would say use a TextReader if you want to examine every character and
  20. perhaps back up; otherwise just use FW_CString::FindCharacter.
  21.  
  22. If you use a TextReader the code would look something like this:
  23.   FW_CMemoryReader* reader = FW_NEW(FW_CMemoryReader, (bufferPtr,
  24. numberOfBytes));
  25.   while (reader->GetPosition() < reader->GetByteCount())
  26.   {
  27.     FW_LChar ch = reader->GetCharacterAndAdvance();
  28.     if (ch == chTab) ...
  29.   }
  30.  
  31. If the text is already in the form of an FW_CString, you can create a
  32. StringReader:
  33.   FW_CStringReader* reader = FW_NEW(FW_CStringReader, (string));
  34. The loop would be the same as above.
  35.  
  36. Mary Boetcher
  37. ODF Person
  38.  
  39.  
  40.  
  41. ........................................................................
  42.  Henri Lamiraux                                      lamiraux@apple.com
  43.  Apple Computer, Inc.                 OpenDoc(tm) Development Framework
  44. ........................................................................
  45.  
  46.